package com.weijian.dal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.io.Serializable;

/**
 * 购物车表
 */
@Data
@Schema(description = "购物车表")
@TableName(value = "cart", autoResultMap = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Cart extends BaseDO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 购物车条目id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "购物车条目id ")
    private Long id;

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    private Long userId;

    /**
     * sku商品id
     */
    @Schema(description = "sku商品id")
    private Long itemId;

    /**
     * 购买数量
     */
    @Schema(description = "购买数量")
    private Integer num;

    /**
     * 商品标题
     */
    @Schema(description = "商品标题")
    private String name;

    /**
     * 商品动态属性键值集
     */
    @Schema(description = "商品动态属性键值集")
    private String spec;

    /**
     * 价格,单位：分
     */
    @Schema(description = "价格,单位：分")
    private Integer price;

    /**
     * 商品图片
     */
    @Schema(description = "商品图片")
    private String image;

}
